package com.jjyu.controller;

import com.jjyu.entity.Result;
import com.jjyu.service.LLMService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/llm")
public class LLMController {
    @Autowired
    private LLMService llmService;

    // 惊喜一餐 单轮对话
    @GetMapping("/surprise")
    public Result surprise() {
        String surprise = llmService.getSurprise();
        if (surprise.startsWith("err")) {
            return Result.error(surprise);
        }

        return Result.success(surprise);
    }

}
